<%@ page contentType="text/html; charset=UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=7"/>
    <title>物资采购与产品整合管理系统</title>
    <link href="${pageContext.request.contextPath }/css/main.css" rel="stylesheet" type="text/css" media="all"/>
    <script src="${pageContext.request.contextPath }/js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script>
        $(function () {
            $(".btnIconDel").click(function () {
                var id = $(this).next().val();
                if (confirm("是否要删除这条记录？")) {
                    location.href = "${pageContext.request.contextPath}/customer/delete.do?id=" + id;
                }
            });
            $(".btnIconEdit").click(function () {
                var id = $(this).next().val();
                location.href = "${pageContext.request.contextPath}/customer/edit.do?id=" + id;
            });
        })
    </script>
</head>

<body class="content-pages-body">
<div class="content-pages-wrap">
    <div class="commonTitle">
        <h2>&gt;&gt; 客户管理</h2>
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="commonTableSearch">
       	<form id="form-search" name="form-search" action="select.do" method="post">
        <tr>
            <th align="right">客户姓名：</th>
            <td><input name="customerName" type="text" class="inputTextNormal" id="customerName" value="${param.customerName }" /></td>

            <th align="right">
                <input type="submit" class="btnShort" value="检索"/>
            </th>
        </tr>
        </form>
    </table>


    <!--//commonTableSearch-->

    <input type="button" class="btnNormal" value="新增客户"
           onclick="location.href='${pageContext.request.contextPath }/page/system/customer/customeradd.jsp'"/>

    <br>
    <jsp:useBean id="now" class="java.util.Date" scope="page"/>
    <fmt:formatDate value="${now}" pattern="yyyy年MM月dd日"/>
    <table width="101%" border="0" cellpadding="0" cellspacing="1" class="commonTable">
        <tr>
            <th>客户姓名</th>
            <th>电话</th>
            <th>车牌号</th>
            <th>车型</th>
            <th class="editColDefault">操作</th>
        </tr>
        <c:forEach items="${pageInfo.list }" var="c">
			<tr>
            <td align="center">${c.name }</td>
            <td align="center">${c.tel }</td>
            <td align="center">${c.carno }</td>
            <td align="center">${c.cartype }</td>
                <td align="center">
                    <a href="#" class="btnIconEdit" title="更新"></a><input type="hidden" value="${c.id }"/>
                <a href="#" class="btnIconDel"  title="删除"></a><input type="hidden" value="${c.id }"/>
            </td>
        </tr>         
        </c:forEach>
        
        
        
        
  </table>
    <!--//commonTable-->
    
    <div>
    <%@include file="/page/common/subpage.jsp" %>
    </div>
</div>
<!--//content pages wrap-->
</body>
</html>